package edu.scut.course_management.po;

/**
 * 持久化对象：具体某一节课
 * @author shawshank
 */
public class Section {

	private Integer periodId;
	private String year;
	private String term;
	private Integer courseId;
	private String buildingId;
	private String roomNumber;

	public Section() {
	}

	public Section(Integer periodId, String year, String term, Integer courseId, String buildingId, String roomNumber) {
		this.periodId = periodId;
		this.year = year;
		this.term = term;
		this.courseId = courseId;
		this.buildingId = buildingId;
		this.roomNumber = roomNumber;
	}
	

	public Integer getPeriodId() {
		return periodId;
	}

	public void setPeriodId(Integer periodId) {
		this.periodId = periodId;
	}

	public String getYear() {
		return year;
	}

	public void setYear(String year) {
		this.year = year;
	}

	public String getTerm() {
		return term;
	}

	public void setTerm(String term) {
		this.term = term;
	}

	public Integer getCourseId() {
		return courseId;
	}

	public void setCourseId(Integer courseId) {
		this.courseId = courseId;
	}

	public String getBuildingId() {
		return buildingId;
	}

	public void setBuildingId(String buildingId) {
		this.buildingId = buildingId;
	}

	public String getRoomNumber() {
		return roomNumber;
	}

	public void setRoomNumber(String roomNumber) {
		this.roomNumber = roomNumber;
	}

	@Override
	public boolean equals(Object obj) {
		 if (!(obj instanceof Section)) {
		 	return false;
		 } else {
		 	return  periodId.equals(((Section) obj).getPeriodId()) &&
				    courseId.equals(((Section) obj).getCourseId()) &&
					year.equals(((Section) obj).getYear()) &&
					term.equals(((Section) obj).getTerm()) &&
					buildingId.equals(((Section) obj).getBuildingId()) &&
					roomNumber.equals(((Section) obj).getRoomNumber());
		 }
	}
}
